package com.mzq.langchain4j_springboot.web.controller;


import com.mzq.langchain4j_springboot.config.AiConfig;
import com.mzq.langchain4j_springboot.web.entity.HouseInfo;
import com.mzq.langchain4j_springboot.web.service.HouseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 房产信息
 */
@RestController
@RequestMapping("/system/houseInfo")
public class HouseInfoController {

    @Autowired
    private HouseInfoService houseInfoService;

    @Autowired
    AiConfig.AssistantUnique assistantUnique;

    @PostMapping("/insertHouseInfo")
    public ResponseEntity<Integer> insertHouseInfo(HouseInfo houseInfo) {
        int result = houseInfoService.insertHouse(houseInfo);
        return ResponseEntity.ok(result);
    }

    @PutMapping("/updateHouseInfo")
    public ResponseEntity<Integer> updateHouseInfo(HouseInfo houseInfo) {
        int result = houseInfoService.updateHouse(houseInfo);
        return ResponseEntity.ok(result);
    }
}
